//
//  RLShowContrller.m
//  RelaxLinkProduct
//
//  Created by relax on 2017/11/20.
//  Copyright © 2017年 relax. All rights reserved.
//

#import "RLShowContrller.h"

@interface RLShowContrller ()

@end

@implementation RLShowContrller

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    
    [self initUI];
}

#pragma mark - 初始化 UI
- (void)initUI {
    // 背景图片
    UIImageView *bgImageView = [[UIImageView alloc] init];
    [self.view addSubview:bgImageView];
    [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
    }];
    
    bgImageView.image = [UIImage imageNamed:@"bg_zbfx"];
    
    // 定位按钮
    UIButton *locationButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [locationButton setImage:[UIImage imageNamed:@"UMS_place_off"] forState:UIControlStateNormal];
    [locationButton setTitle:@"北京市" forState:UIControlStateNormal];
    locationButton.titleLabel.font = [UIFont systemFontOfSize:14];
    locationButton.titleEdgeInsets = UIEdgeInsetsMake(0, 5, 0, 0);
    // locationButton.imageView.bounds = CGRectMake(0, 0, 20, 20);
    locationButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
    [locationButton sizeToFit];
    [self.view addSubview:locationButton];
    
    [locationButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(8);
        make.top.offset(20);
        make.height.offset(30);
        make.width.offset(80);
    }];
    
    
    // 关闭按钮
    UIButton *closeButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [closeButton setImage:[UIImage imageNamed:@"UMS_nav_button_close"] forState:UIControlStateNormal];
    // [closeButton setImage:[UIImage imageNamed:@"UMS_shake_close_tap"] forState:UIControlStateHighlighted];
    [closeButton sizeToFit];
    [self.view addSubview:closeButton];
    
    [closeButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-8);
        make.centerY.equalTo(locationButton);
    }];
    
    [closeButton addTarget:self action:@selector(dismissVC) forControlEvents:UIControlEventTouchUpInside];
    
    // 给直播写个标题吧。
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.text = @"给直播起个标题吧";
    titleLabel.font = [UIFont systemFontOfSize:20];
    titleLabel.textColor = [UIColor whiteColor];
    [self.view addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.offset(0);
        make.centerY.offset(-50);
    }];
    
    
    // 开启直播按钮
    UIButton *showButton = [UIButton buttonWithType:UIButtonTypeSystem];
    [showButton setTitle:@"开始直播" forState:UIControlStateNormal];
    [showButton setTitleColor:[UIColor colorWithRed:0.27451 green:0.94510 blue:0.85490 alpha:1.00000] forState:UIControlStateNormal];
    CGFloat buttonW = SCREEN_WIDTH - 100;
    CGFloat buttonH = 40;
    showButton.layer.borderWidth = 1;
    showButton.layer.borderColor = [UIColor colorWithRed:0.25098 green:0.51765 blue:0.44706 alpha:1.00000].CGColor;
    showButton.layer.cornerRadius = buttonH * 0.5;
    
    
    [self.view addSubview:showButton];
    
    [showButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.offset(0);
        make.width.offset(buttonW);
        make.height.offset(buttonH);
    }];
    
    
    
}

#pragma mark - 关闭当前控制器
- (void)dismissVC {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
